package io.renren.modules.teacher.controller;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.teacher.service.CourseStudentManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/course/studentManage")
public class CourseStudentManageController {
    @Autowired
    private CourseStudentManageService courseStudentManageService;
    /*
    获得每个课程的学生列表
     */
    @GetMapping("/list")
    public R list(@RequestParam Map<String,Object> params){
        PageUtils pageUtils = courseStudentManageService.list(params);
        return R.ok().put("page",pageUtils);
    }
    /*
    删除学生
     */
    @PostMapping("/delete/{courseInfoId}")
    public R delete(@RequestBody String[] listIds,@PathVariable("courseInfoId") String courseInfoid){
         courseStudentManageService.delete(listIds,courseInfoid);
        return R.ok();
    }
}
